package o;

import android.content.res.ColorStateList;
import android.graphics.PorterDuff.Mode;
import android.graphics.drawable.Drawable;
import android.os.Build.VERSION;
import android.widget.CompoundButton;
import com.huawei.skinner.annotation.SkinAdapter;

public class fpe {
    @SkinAdapter("button")
    public static void ˋ(CompoundButton compoundButton, Drawable drawable) {
        compoundButton.setButtonDrawable(drawable);
    }

    @SkinAdapter("buttonTint")
    public static void ˊ(CompoundButton compoundButton, ColorStateList colorStateList) {
        iq.ॱ(compoundButton, colorStateList);
        if (VERSION.SDK_INT < 21 && !(compoundButton instanceof je)) {
            Object ˎ = fmt.ˎ(CompoundButton.class, compoundButton, "mButtonDrawable");
            if (ˎ != null && (ˎ instanceof Drawable)) {
                Drawable drawable = (Drawable) ˎ;
                Drawable mutate = gg.ʻ(drawable).mutate();
                gg.ॱ(mutate, colorStateList);
                gg.ˋ(mutate, Mode.SRC_IN);
                if (drawable != mutate) {
                    compoundButton.setButtonDrawable(mutate);
                }
            }
        }
    }
}
